package com.rgs.platform.controller;

import com.rgs.base.core.model.WebApiReturnResultModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Ren Gaoshuai
 * @ClassName TestAuthorityController
 * @date 2022-01-24 10:52
 **/
@Api(tags = "测试接口")
@RestController
@RequestMapping("/v1/test")
public class TestAuthorityController {

    @ApiOperation(value = "测试登录权限接口")
    @PostMapping("/test1")
    public WebApiReturnResultModel<Void> test(){
        System.out.println("测试成功！");
        return WebApiReturnResultModel.ofSuccess();
    }

    @Resource
    RedisTemplate redisTemplate;
    public static final String key1="list:";

    public void method1() {
        List<String> list1 = new ArrayList<>();
        list1.add("a");
        list1.add("b");
        String s1="12";
        redisTemplate.opsForList().rightPush(key1,s1);
    }
}
